#include <stdio.h>
#include <stdlib.h>

void insert_sort(int a[], int len)
{
	int i, j, temp;
	if(a == NULL || len == 0)
		return;

	for(i = 1;i<len;i++)
	{
		temp = a[i];
		for(j = i-1;j>=0;j--)
		{
			if(a[j] > temp)
				a[j+1] = a[j];
			else
				break;
		}
		a[j+1] =temp;
	}
}

int main()
{
	int i;
	int data[] = {2,3,6,1,0,8};
	insert_sort(data, 6);
	printf("data is:");
	for(i = 0;i<6;i++)
		printf("%d ", data[i]);
	printf("\n");
	return 0;
}